#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "qpixmap.h"
#include <qstate.h>
#include "qstatemachine.h"
#include "qdesktopwidget.h"
#include "qprocess.h"
#include "qtextcodec.h"
#include "qchar.h"
#include <QTime>
#include "qlabel.h"


void MainWindow::new_wiget(void)
{
    //button1 = new QPushButton(ui->centralWidget);
    //down_up_frame = new QFrame(ui->centralWidget);
    //down_up_frame1= new QFrame(ui->centralWidget);
    up_frame1 = new QFrame(ui->centralWidget);
    up_frame2= new QFrame(ui->centralWidget);
    down_frame1 = new QFrame(ui->centralWidget);
    down_frame2= new QFrame(ui->centralWidget);

    label_time = new QLabel(ui->centralWidget);
    label_floor = new QLabel(ui->centralWidget);
    label_floor1 = new QLabel(ui->centralWidget);
    label_spec_info = new QLabel(ui->centralWidget);
    label_spec_info1 = new QLabel(ui->centralWidget);
    label_date = new QLabel(ui->centralWidget);
    label_week = new QLabel(ui->centralWidget);
    label_copy_schedule = new QLabel(ui->centralWidget);

    logo_frame = new QFrame(ui->centralWidget);
    process0=new QProcess();
    process1=new QProcess();
    cp_process =new QProcess();
    uart0_timer = new QTimer;
    copy_file_timer = new QTimer;
    //ReadThread = new ReadThread(ui->centralWidget);
}




void MainWindow::set_widget_bg()
{

//ui->label_4->setStyleSheet("background-color: QColor(54,54,54)");
    ui->label_4->setStyleSheet("background-color: rgb(54,54,54)");
    //ui->label_1->setStyleSheet("background-color: red");

//ui->label_3->setStyleSheet("background-color: black");
//ui->label_2->setStyleSheet("background-color: black");
//ui->label_5->setStyleSheet("background-color: black");
}





void MainWindow::set_fonts()
{
    //ui->pushButton->hide();
    //button1->setText(tr("10"));
    //button1->setStyleSheet("font-size : 100px");
    //button1->hide();
    //ui->label_2->setStyleSheet("font-size : 32px");
    //ui->label_2->hide();
    QString fonts_size;
    fonts_size.sprintf("font-size : %dpx",label_time->geometry().height()-4);

    label_time->setStyleSheet(fonts_size);
    label_date->setStyleSheet(fonts_size);
    label_week->setStyleSheet(fonts_size);
    label_date->setAlignment(Qt::AlignHCenter);
    label_week->setAlignment(Qt::AlignHCenter);
    label_time->setAlignment(Qt::AlignHCenter);

    fonts_size.sprintf("font-size : %dpx",label_floor->geometry().height());
    label_floor->setStyleSheet(fonts_size);
    label_floor->setAlignment(Qt::AlignCenter);
    label_floor1->setStyleSheet(fonts_size);
    label_floor1->setAlignment(Qt::AlignCenter);
    //label_floor->setText("55");
    //label_floor->font().setBold();
    fonts_size.sprintf("font-size : %dpx",ui->label_1->geometry().height()-8);
    ui->label->setStyleSheet(fonts_size);

    ui->label_1->setStyleSheet(fonts_size);
    ui->label_2->setStyleSheet(fonts_size);

    ui->label_3->setStyleSheet(fonts_size);

    ui->label->setStyleSheet(fonts_size);
    //QFont font0;
    //font0.setFamily("LcdD");

    fonts_size.sprintf("font-size : %dpx", label_spec_info->geometry().height());
    label_spec_info->setStyleSheet(fonts_size);

    label_spec_info->setAlignment(Qt::AlignCenter);
    label_spec_info->setPalette(palette_red);
    label_spec_info1->setStyleSheet(fonts_size);
    label_spec_info1->setAlignment(Qt::AlignCenter);
    label_spec_info1->setPalette(palette_red);
}



void MainWindow::set_dis_config()
{

    //将字体文件名传给addApplicationFont,得到字体的Id
    QString tmp_line;// = "../fonts/hw_kt.ttf";
    tmp_line = current_dir + "/fonts/hw_kt.ttf";
    int fontId = QFontDatabase::addApplicationFont(tmp_line);
    //将字体Id传给applicationFontFamilies,得到一个QStringList,其中的第一个元素为新添加字体的family
    QString msyh = QFontDatabase::applicationFontFamilies ( fontId ).at(0);
    QFont font0(msyh,10);

    ui->label->setFont(font0);
    ui->label_1->setFont(font0);
    ui->label_2->setFont(font0);

    ui->label_5->setFont(font0);
    label_week->setFont(font0);
    label_time->setFont(font0);
    label_date->setFont(font0);
    label_spec_info->setFont(font0);
    label_spec_info1->setFont(font0);

    tmp_line = "";
	tmp_line = current_dir + "/fonts/floor.ttf";
    //tmp_line = "../fonts/floor.ttf";
    fontId = QFontDatabase::addApplicationFont(tmp_line);
    msyh = QFontDatabase::applicationFontFamilies ( fontId ).at(0);
    QFont font1(msyh,10,QFont::Bold);
    //font1.setBold();
    label_floor->setFont(font1);
    label_floor1->setFont(font1);

#if 0
    if(elevator_num!="2")
    {
    label_spec_info1->hide();
    label_floor1->hide();
    ui->label->hide();

    }
#endif

}


void MainWindow::set_widget_size()
{

    QSize frame, frame2,label_w,label_h;
    qint32 tmp;

    ui->frame_2->setLineWidth(3);
    ui->frame_2->setMidLineWidth(3);
    tmp = ui->frame_2->lineWidth();

    ui->label->move(screenrect.width()+1,screenrect.height()*17/18);
    ui->label_1->move(screenrect.width()+1,screenrect.height()*17/18);

    label_copy_schedule->hide();

    if(elevator_num == "2")
    {

        frame2.setHeight( screenrect.height()*(ratio_y-2)/ratio_y);
        frame2.setWidth(screenrect.width()*(ratio_x-2)/ratio_x);

        frame.setHeight(screenrect.height()*(ratio_y-2)/ratio_y - tmp*4);
        frame.setWidth(screenrect.width()*(ratio_x-2)/ratio_x -tmp*4 );

        label_w.setHeight( screenrect.height()/ratio_y);
        label_w.setWidth(screenrect.width());

        label_h.setHeight( screenrect.height()*(ratio_y-2)/ratio_y);
        label_h.setWidth(screenrect.width()/ratio_x);

        ui->frame->setFixedSize(frame);
        ui->frame_2->setFixedSize(frame2);

        ui->label_2->setFixedSize(label_h);  //the left black label
        ui->label_3->setFixedSize(label_h); // the right black lable

        ui->label_4->setFixedSize(screenrect.width() ,screenrect.height()); //the top black label
        ui->label_5->setFixedSize(label_w);//the bottom black label

        ui->frame_2->move(screenrect.width()/ratio_x,screenrect.height()/ratio_y);
        ui->frame->move(tmp*2,tmp*2);

        ui->label_2->move(0,screenrect.height()/ratio_y);
        ui->label_3->move(screenrect.width()*(ratio_x-1)/ratio_x,screenrect.height()/ratio_y);

        ui->label_4->move(0,0);

        ui->label_5->move(0,screenrect.height()*(ratio_y-1)/ratio_y);

        ui->label_2->hide();
        ui->label_3->hide();
        ui->label_5->hide();

        logo_frame->setFixedSize(screenrect.width()/ratio_x,screenrect.height()/5);
        logo_frame->move(0,screenrect.height()/ratio_y);


    //tmp_line = current_dir;
#if 0
    tmp_line =":/images/up.png";
    image1.load(tmp_line);
    image_size = image1.size();

    down_up_frame->resize(image_size);
    down_up_frame->move(screenrect.width()/(2*ratio_x)-image_size.width()/2,logo_frame->geometry().bottom()+screenrect.height()/30);
    image2 = image1.scaled(down_up_frame->size());
    palette00.setBrush(down_up_frame->backgroundRole(),QBrush(image2));
    //palette00.setBrush(down_up_frame->backgroundRole(),QBrush(pixmap00));
    down_up_frame->setPalette(palette00);
    down_up_frame->setAutoFillBackground(true);
    down_up_frame->hide();
#endif

    up_frame1->move(screenrect.width()/(2*ratio_x)-up_frame1->size().width()/2,logo_frame->geometry().bottom()+screenrect.height()/30);
    down_frame1->move(screenrect.width()/(2*ratio_x)-down_frame1->size().width()/2,logo_frame->geometry().bottom()+screenrect.height()/30);




    // label_time->setGeometry(screenrect.width()*4/5,screenrect.height()*9/10-50,screenrect.width()/5,50);
    label_floor->move(QPoint(0,screenrect.height()/36+up_frame1->geometry().bottom()));
    label_floor->setFixedSize(screenrect.width()/ratio_x,screenrect.height()/5);

    label_spec_info->setFixedSize(screenrect.width()/ratio_x,screenrect.height()/18);
    label_spec_info->move(label_floor->geometry().bottomLeft() + QPoint(0,10));

    label_date->setFixedSize(screenrect.width()/ratio_x,screenrect.height()/20);
    label_date->move(ui->frame_2->geometry().topRight()+QPoint(1,0));

    label_week->setFixedSize(screenrect.width()/ratio_x,screenrect.height()/18);
    label_week->move(label_date->geometry().bottomLeft() + QPoint(1,8));

    label_time->setFixedSize(screenrect.width()/ratio_x,screenrect.height()/20);
    label_time->move(label_week->geometry().bottomLeft() + QPoint(1,8));

#if 0
    tmp_line =  current_dir;

    tmp_line +="/images/up.png";
    image1.load(tmp_line);
    image_size = image1.size();
    down_up_frame1->resize(image_size);
    down_up_frame1->move(QPoint(screenrect.width()-down_up_frame->geometry().right(),down_up_frame->geometry().top()));
    image2 = image1.scaled(down_up_frame1->size());
    palette00.setBrush(down_up_frame1->backgroundRole(),QBrush(image2));
    down_up_frame1->setPalette(palette00);
    down_up_frame1->setAutoFillBackground(true);
    down_up_frame1->hide();
#endif

    up_frame2->move(QPoint(screenrect.width()-up_frame1->geometry().right(),up_frame1->geometry().top()));
    down_frame2->move(QPoint(screenrect.width()-up_frame1->geometry().right(),up_frame1->geometry().top()));



    label_floor1->setFixedSize(screenrect.width()/ratio_x,screenrect.height()/5);
    label_floor1->move(QPoint(screenrect.width()*(ratio_x-1)/ratio_x , screenrect.height()/36+up_frame2->geometry().bottom()));

#ifdef qt_mplayer_test
    label_floor1->setText("12");
   // QPalette palette_floor;
   // palette_floor = label_floor1->palette();
    //palette_floor.setColor(QPalette::WindowText,QColor("yellow"));
    label_floor1->setPalette(palette_yellow);
    label_floor1->show();

    label_floor->setText("15");
    //palette_floor = label_floor->palette();
    //palette_floor.setColor(QPalette::WindowText,QColor("yellow"));
    label_floor->setPalette(palette_yellow);
    label_floor->show();
    //label_floor1->show();

    label_spec_info1->setText(tr("超载"));
    label_spec_info1->show();
    label_spec_info->setText(tr("超载"));
    label_spec_info->show();

    //up_frame1->show();
    //up_frame2->show();
#endif
    up_frame2->hide();
    label_floor1->hide();

    label_spec_info1->setFixedSize(screenrect.width()/ratio_x,screenrect.height()/18);
    label_spec_info1->move(screenrect.width()*(ratio_x-1)/ratio_x,label_spec_info->geometry().top());
    //move_pos = screenrect.width();
    //bottom_move_pos = screenrect.width();
    }
    else  // for the single elevator
    {
        if(display_pos =="2")
        {


            //ui->label_1->hide();
            ui->label_2->hide();
            ui->label_3->hide();
            ui->label_5->hide();
            //down_up_frame1->hide();
            frame2.setHeight( screenrect.height()*(ratio_y-1)/ratio_y);
            frame2.setWidth(screenrect.width()*(ratio_x-1)/ratio_x);

            frame.setHeight(screenrect.height()*(ratio_y-1)/ratio_y - tmp*4);
            frame.setWidth(screenrect.width()*(ratio_x-1)/ratio_x -tmp*4 );
            ui->frame->setFixedSize(frame);
            ui->frame_2->setFixedSize(frame2);
            ui->frame_2->move(0,0);
            ui->frame->move(tmp*2,tmp*2);
            ui->label_4->setFixedSize(screenrect.width() ,screenrect.height()); //the top black label
            ui->label_4->move(0,0);

            //logo_frame->setFixedSize(screenrect.width()/ratio_x,screenrect.height()/5);
            logo_frame->move(ui->frame_2->geometry().right(),0);


#if 0

            QImage image1;
            QSize image_size;
            QPalette  palette00;

            QString tmp_line1 =  current_dir;

            tmp_line1 +="/images/logo.jpg";
            qDebug("%s", qPrintable(tmp_line1));

            image1.load(tmp_line1);
            if(image1.isNull())
                qDebug("load image fail....");

            QImage image2 = image1.scaled(logo_frame->size());
            palette00.setBrush(logo_frame->backgroundRole(),QBrush(image2));
            logo_frame->setPalette(palette00);
            logo_frame->setAutoFillBackground(true);
            logo_frame->show();
#endif

#if 0
            QString tmp_line1 =  current_dir;
            QImage image2;
            tmp_line1 +="/images/logo.jpg";
            qDebug("%s", qPrintable(tmp_line1));
            image1.load(tmp_line1);
            if(image1.isNull())
            {
                    tmp_line1 =  current_dir;

                    tmp_line1 +="/images/logo1.jpg";
                    qDebug("%s", qPrintable(tmp_line1));
                    image1.load(tmp_line1);
                    if(image1.isNull())
                        qDebug("load image fail....");
                    {
                        image2 = image1.scaled(logo_frame->size());
                        palette00.setBrush(logo_frame->backgroundRole(),QBrush(image2));
                        logo_frame->setPalette(palette00);
                        logo_frame->setAutoFillBackground(true);
                        logo_frame->show();

                    }
            }
            else
            {
            image2 = image1.scaled(logo_frame->size());
            palette00.setBrush(logo_frame->backgroundRole(),QBrush(image2));
            logo_frame->setPalette(palette00);
            logo_frame->setAutoFillBackground(true);
            logo_frame->show();
            }

            tmp_line1 =  current_dir;

            tmp_line1 +="/images/up.png";
            image1.load(tmp_line1);
            image_size = image1.size();
            down_up_frame->resize(image_size);
            down_up_frame->move(ui->frame_2->geometry().right()+screenrect.width()/(2*ratio_x)-image_size.width()/2,logo_frame->geometry().bottom()+screenrect.height()/30);
            image2 = image1.scaled(down_up_frame->size());
            palette00.setBrush(down_up_frame->backgroundRole(),QBrush(image2));
            down_up_frame->setPalette(palette00);
            down_up_frame->setAutoFillBackground(true);
            down_up_frame->hide();
#endif


            //move_pos = screenrect.width();
            up_frame1->move(ui->frame_2->geometry().right()+screenrect.width()/(2*ratio_x)-up_frame1->size().width()/2,logo_frame->geometry().bottom()+screenrect.height()/30);
            down_frame1->move(ui->frame_2->geometry().right()+screenrect.width()/(2*ratio_x)-down_frame1->size().width()/2,logo_frame->geometry().bottom()+screenrect.height()/30);

            label_floor->move(QPoint(ui->frame_2->geometry().right(),screenrect.height()/36+up_frame1->geometry().bottom()));
            label_floor->setFixedSize(screenrect.width()/ratio_x,screenrect.height()/5);

            label_spec_info->setFixedSize(screenrect.width()/ratio_x,screenrect.height()/18);
            label_spec_info->move(label_floor->geometry().bottomLeft() + QPoint(0,10));

            label_date->setFixedSize(screenrect.width()/ratio_x,screenrect.height()/20);
            label_date->move(label_spec_info->geometry().bottomLeft()+QPoint(1,8));

            label_week->setFixedSize(screenrect.width()/ratio_x,screenrect.height()/18);
            label_week->move(label_date->geometry().bottomLeft() + QPoint(1,8));

            label_time->setFixedSize(screenrect.width()/ratio_x,screenrect.height()/20);
            label_time->move(label_week->geometry().bottomLeft() + QPoint(1,8));

            //bottom_move_pos = screenrect.width();
        }
        else
        {
        frame2.setHeight( screenrect.height()*(ratio_y-1)/ratio_y);
        frame2.setWidth(screenrect.width()*(ratio_x-1)/ratio_x);

        frame.setHeight(screenrect.height()*(ratio_y-1)/ratio_y - tmp*4);
        frame.setWidth(screenrect.width()*(ratio_x-1)/ratio_x -tmp*4 );
        ui->frame->setFixedSize(frame);
        ui->frame_2->setFixedSize(frame2);
        ui->frame_2->move(screenrect.width()/ratio_x,0);
        ui->frame->move(tmp*2,tmp*2);
        ui->label_4->setFixedSize(screenrect.width() ,screenrect.height()); //the top black label
        ui->label_4->move(0,0);

        logo_frame->setFixedSize(screenrect.width()/ratio_x,screenrect.height()/5);
        logo_frame->move(0,0);


#if 0
        QImage image1;
        QSize image_size;
        QPalette  palette00;
        QString tmp_line1 =  current_dir;
        QImage image2;
        tmp_line1 +="/images/logo.jpg";
        qDebug("%s", qPrintable(tmp_line1));
        image1.load(tmp_line1);

        if(image1.isNull())
        {
            tmp_line1 =  current_dir;

            tmp_line1 +="/images/logo1.jpg";
            qDebug("%s", qPrintable(tmp_line1));
            image1.load(tmp_line1);
            if(image1.isNull())
                qDebug("load image fail....");
            {
                image2 = image1.scaled(logo_frame->size());
                palette00.setBrush(logo_frame->backgroundRole(),QBrush(image2));
                logo_frame->setPalette(palette00);
                logo_frame->setAutoFillBackground(true);
                logo_frame->show();

            }
        }
        else
        {
            image2 = image1.scaled(logo_frame->size());
            palette00.setBrush(logo_frame->backgroundRole(),QBrush(image2));
            logo_frame->setPalette(palette00);
            logo_frame->setAutoFillBackground(true);
            logo_frame->show();
        }

        tmp_line1 =  current_dir;
        tmp_line1 +="/images/up.png";

        image1.load(tmp_line1);
        image_size = image1.size();
        down_up_frame->resize(image_size);
        down_up_frame->move(screenrect.width()/(2*ratio_x)-image_size.width()/2,logo_frame->geometry().bottom()+screenrect.height()/30);
        image2 = image1.scaled(down_up_frame->size());
        palette00.setBrush(down_up_frame->backgroundRole(),QBrush(image2));
        down_up_frame->setPalette(palette00);
        down_up_frame->setAutoFillBackground(true);
        down_up_frame->hide();
#endif

            up_frame1->move(screenrect.width()/(2*ratio_x)-up_frame1->size().width()/2,logo_frame->geometry().bottom()+screenrect.height()/30);
            down_frame1->move(screenrect.width()/(2*ratio_x)-down_frame1->size().width()/2,logo_frame->geometry().bottom()+screenrect.height()/30);
            label_floor->move(QPoint(0,screenrect.height()/36+up_frame1->geometry().bottom()));
            label_floor->setFixedSize(screenrect.width()/ratio_x,screenrect.height()/5);

            label_spec_info->setFixedSize(screenrect.width()/ratio_x,screenrect.height()/18);
            label_spec_info->move(label_floor->geometry().bottomLeft() + QPoint(0,10));

            label_date->setFixedSize(screenrect.width()/ratio_x,screenrect.height()/20);
            label_date->move(label_spec_info->geometry().bottomLeft()+QPoint(1,8));

            label_week->setFixedSize(screenrect.width()/ratio_x,screenrect.height()/18);
            label_week->move(label_date->geometry().bottomLeft() + QPoint(1,8));

            label_time->setFixedSize(screenrect.width()/ratio_x,screenrect.height()/20);
            label_time->move(label_week->geometry().bottomLeft() + QPoint(1,8));

            //bottom_move_pos = screenrect.width();
        }

    }

    ui->label->setFixedSize(screenrect.width(),screenrect.height()/ratio_y);
    ui->label_1->setFixedSize(screenrect.width(),screenrect.height()/ratio_y);



}



void MainWindow::picture_load()
{

        #if 1
        QImage image1;
        QString tmp_line2;
        tmp_line2 = current_dir + "/images/bg.png";
        image1.load(tmp_line2);
        QSize image_size = ui->frame->size();
        QImage image2 = image1.scaled(image_size);//.scaled(88*2,103*2);

        QPalette  palette00;
        palette00.setBrush(ui->frame->foregroundRole(),QBrush(image2));
        //palette00.setBrush(down_up_frame->backgroundRole(),QBrush(pixmap00));
        ui->frame->setPalette(palette00);
        ui->frame->setAutoFillBackground(true);
        //down_up_frame->resize(image_size);
        ui->frame->show();
        #endif

        //QImage image1;
        //QSize image_size;
        //QPalette  palette00;
        QString tmp_line;// =  current_dir;
        //QImage image2;

        logo_frame->setFixedSize(screenrect.width()/ratio_x,screenrect.height()/5);
        //logo_frame->move(0,0);

        tmp_line =current_dir + "/images/logo.jpg";
        qDebug("%s", qPrintable(tmp_line));
        image1.load(tmp_line,"JPG");
        if(image1.isNull())
        {
            //tmp_line =  current_dir;

            tmp_line =current_dir + "/images/logo1.jpg";
            qDebug("%s", qPrintable(tmp_line));
            image1.load(tmp_line,"JPG");
            if(image1.isNull())
            {
                qDebug("load image fail....");
            }
            else
            {
                image2 = image1.scaled(logo_frame->size(),Qt::IgnoreAspectRatio,Qt::SmoothTransformation);
                palette00.setBrush(logo_frame->backgroundRole(),QBrush(image2));
                logo_frame->setPalette(palette00);
                logo_frame->setAutoFillBackground(true);
                logo_frame->show();
            }
        }
        else
        {
            //qDebug("width:%d,height:%d",screenrect.width()/ratio_x,screenrect.height()/5);
            image2 = image1.scaled(logo_frame->size(),Qt::IgnoreAspectRatio,Qt::SmoothTransformation);
            palette00.setBrush(logo_frame->backgroundRole(),QBrush(image2));
            logo_frame->setPalette(palette00);
            logo_frame->setAutoFillBackground(true);
            logo_frame->show();
        }

        tmp_line =":/images/up.png";
        image1.load(tmp_line);
        image_size = image1.size();
        up_frame1->resize(image_size);
        //up_frame1->move(screenrect.width()/(2*ratio_x)-image_size.width()/2,logo_frame->geometry().bottom()+screenrect.height()/30);
        image2 = image1.scaled(up_frame1->size());
        palette00.setBrush(up_frame1->backgroundRole(),QBrush(image2));
        //palette00.setBrush(down_up_frame->backgroundRole(),QBrush(pixmap00));
        up_frame1->setPalette(palette00);
        up_frame1->setAutoFillBackground(true);
        up_frame1->hide();

        tmp_line =":/images/down.png";
        image1.load(tmp_line);
        image_size = image1.size();
        down_frame1->resize(image_size);
        //down_frame1->move(screenrect.width()/(2*ratio_x)-image_size.width()/2,logo_frame->geometry().bottom()+screenrect.height()/30);
        image2 = image1.scaled(down_frame1->size());
        palette00.setBrush(up_frame1->backgroundRole(),QBrush(image2));
        //palette00.setBrush(down_up_frame->backgroundRole(),QBrush(pixmap00));
        down_frame1->setPalette(palette00);
        down_frame1->setAutoFillBackground(true);
        down_frame1->hide();




        tmp_line =":/images/up.png";
        image1.load(tmp_line);
        image_size = image1.size();
        up_frame2->resize(image_size);
        //up_frame2->move(QPoint(screenrect.width()-up_frame1->geometry().right(),up_frame1->geometry().top()));
        image2 = image1.scaled(up_frame2->size());
        palette00.setBrush(up_frame2->backgroundRole(),QBrush(image2));
        up_frame2->setPalette(palette00);
        up_frame2->setAutoFillBackground(true);
        up_frame2->hide();



        tmp_line =":/images/down.png";
        image1.load(tmp_line);
        image_size = image1.size();
        down_frame2->resize(image_size);
        //down_frame2->move(QPoint(screenrect.width()-up_frame1->geometry().right(),up_frame1->geometry().top()));
        image2 = image1.scaled(down_frame2->size());
        palette00.setBrush(down_frame2->backgroundRole(),QBrush(image2));
        down_frame2->setPalette(palette00);
        down_frame2->setAutoFillBackground(true);
        down_frame2->hide();

        if(elevator_num == "2")
        {
            //down_frame1->show();
            //up_frame2->show();

        }
        else
        {
            //up_frame1->show();
        }



}
